package com.koron.housing.statistics.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.koron.bean.query.PageQuery;
import com.koron.common.core.interceptor.OrderByInterceptor;
import com.koron.housing.contract.bean.param.HousingContractBillParam;
import com.koron.housing.contract.bean.vo.HousingContractStatistics;
import com.koron.housing.info.bean.query.HousingInfoStatisticsQuery;
import com.koron.housing.info.bean.vo.HousingInfoStatistics;
import com.koron.housing.staff.bean.query.HousingStaffStatisticsQuery;
import com.koron.housing.staff.bean.vo.HousingStaffStatistics;
import org.koron.ebs.mybatis.SessionFactory;

import java.util.List;

/**
 * @author jzp
 * @since 2022/3/10
 */
public interface HousingStatisticsService {

    List<HousingStaffStatistics> listLease(SessionFactory factory, HousingStaffStatisticsQuery query);

    default PageInfo<HousingStaffStatistics> pageLease(SessionFactory factory, PageQuery pageQuery, HousingStaffStatisticsQuery query) {
        OrderByInterceptor.setOrderBy(pageQuery.getOrders());
        PageHelper.startPage(pageQuery.getPage(), pageQuery.getPageSize());
        List<HousingStaffStatistics> housingStaffList = listLease(factory, query);
        return new PageInfo<>(housingStaffList);
    }

    List<HousingInfoStatistics> listInfo(SessionFactory factory, HousingInfoStatisticsQuery query);

    List<HousingContractStatistics> listBill(SessionFactory factory, HousingContractBillParam query);

}
